package uk.co.magiclantern.mvc.controller
{
	
	import flash.display.Sprite;
	import flash.events.EventDispatcher;
	import uk.co.magiclantern.mvc.imvc.IController;
	import uk.co.magiclantern.mvc.imvc.*;
	import flash.events.Event;
	import flash.utils.Proxy;
	
	public class MLPAbstractEventController extends EventDispatcher implements IController
	{
		 
		private var _view:IView;
		private var _model:IModel;
	
		
		public function MLPAbstractEventController (m:IModel, v:IView)
		{
			model = m;
			view = v;
		}
		
		public function genericfunction(func:String, ...rest):void
		{
			try
			{
			
			 if (rest.length > 0)
			this[func](rest);
			else
			this[func]();
			} catch (e:ReferenceError){
				var mcp:MLPControllerProxy = new MLPControllerProxy();
				mcp.callProperty(func, rest)
				
			}
			
			/**/
	}
		public function set model(m:IModel):void
	 	{
	 		_model = m;
	 	}
	 	
	 	public function get model():IModel
	 	{
	 		return _model;
	 	}
		
		public function set view(v:IView):void
	 	{
	 		_view = v;
	 	}
	 	
	 	public function get view():IView
	 	{
	 		return _view;
	 	}
	 	
	}
	
}

include "controlrproxyinclude.as"